﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
	<Style x:Key="TreeViewItem" TargetType="TreeViewItem">
		<Setter Property="Padding" Value="0,2,6,2" />
		<Setter Property="Margin" Value="0,0,0,-1" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type TreeViewItem}">
					<Grid>
						<Grid.RowDefinitions>
							<RowDefinition Height="Auto" />
							<RowDefinition />
						</Grid.RowDefinitions>
						<Border x:Name="Border" BorderThickness="1" BorderBrush="Transparent" SnapsToDevicePixels="True"
								Background="Transparent" Padding="{TemplateBinding Padding}" Cursor="Hand">
							<Grid>
								<Grid.ColumnDefinitions>
									<ColumnDefinition MinWidth="19" Width="Auto" />
									<ColumnDefinition Width="Auto" />
									<ColumnDefinition Width="*" />
								</Grid.ColumnDefinitions>
								<ToggleButton x:Name="Expander" ClickMode="Press"
										IsChecked="{Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}}">
									<ToggleButton.Style>
										<Style TargetType="{x:Type ToggleButton}">
											<Setter Property="Focusable" Value="False" />
											<Setter Property="Width" Value="16" />
											<Setter Property="Height" Value="16" />
											<Setter Property="Template">
												<Setter.Value>
													<ControlTemplate TargetType="{x:Type ToggleButton}">
														<Border Background="Transparent" Height="16" Padding="5"
																Width="16">
															<Path x:Name="ExpandPath" Data="M0,0 L0,6 L6,0 z"
																	Fill="White" Stroke="#FF818181">
																<Path.RenderTransform>
																	<RotateTransform Angle="135" CenterY="3" CenterX="3" />
																</Path.RenderTransform>
															</Path>
														</Border>
														<ControlTemplate.Triggers>
															<Trigger Property="IsChecked" Value="True">
																<Setter Property="RenderTransform"
																		TargetName="ExpandPath">
																	<Setter.Value>
																		<RotateTransform Angle="180" CenterY="3"
																				CenterX="3" />
																	</Setter.Value>
																</Setter>
																<Setter Property="Fill" TargetName="ExpandPath"
																		Value="#FF595959" />
																<Setter Property="Stroke" TargetName="ExpandPath"
																		Value="#FF262626" />
															</Trigger>
															<Trigger Property="IsMouseOver" Value="True">
																<Setter Property="Stroke" TargetName="ExpandPath"
																		Value="#FF27C7F7" />
																<Setter Property="Fill" TargetName="ExpandPath"
																		Value="#FFCCEEFB" />
															</Trigger>
															<MultiTrigger>
																<MultiTrigger.Conditions>
																	<Condition Property="IsMouseOver" Value="True" />
																	<Condition Property="IsChecked" Value="True" />
																</MultiTrigger.Conditions>
																<Setter Property="Stroke" TargetName="ExpandPath"
																		Value="#FF1CC4F7" />
																<Setter Property="Fill" TargetName="ExpandPath"
																		Value="#FF82DFFB" />
															</MultiTrigger>
														</ControlTemplate.Triggers>
													</ControlTemplate>
												</Setter.Value>
											</Setter>
										</Style>
									</ToggleButton.Style>
								</ToggleButton>
								<ContentPresenter x:Name="PART_Header" Grid.Column="1"
										ContentTemplate="{TemplateBinding HeaderTemplate}"
										Content="{TemplateBinding Header}"
										ContentStringFormat="{TemplateBinding HeaderStringFormat}"
										ContentSource="Header"
										HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
										SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
							</Grid>
						</Border>
						<ItemsPresenter x:Name="ItemsHost" Grid.Row="1" />
					</Grid>
					<ControlTemplate.Triggers>
						<Trigger Property="IsExpanded" Value="False">
							<Setter Property="Visibility" TargetName="ItemsHost" Value="Collapsed" />
						</Trigger>
						<Trigger Property="HasItems" Value="False">
							<Setter Property="Visibility" TargetName="Expander" Value="Hidden" />
						</Trigger>
						<Trigger Property="IsMouseOver" SourceName="Border" Value="True">
							<Setter Property="Background" TargetName="Border" Value="#1F26A0DA" />
							<Setter Property="BorderBrush" TargetName="Border" Value="#A826A0DA" />
							<Setter Property="Panel.ZIndex" Value="2" />
						</Trigger>
						<Trigger Property="IsSelected" Value="True">
							<Setter Property="Background" TargetName="Border" Value="#3D26A0DA" />
							<Setter Property="BorderBrush" TargetName="Border" Value="#FF26A0DA" />
							<Setter Property="Panel.ZIndex" Value="1" />
						</Trigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsSelected" Value="True" />
								<Condition Property="IsSelectionActive" Value="False" />
							</MultiTrigger.Conditions>
							<Setter Property="Background" TargetName="Border" Value="#3DDADADA" />
							<Setter Property="BorderBrush" TargetName="Border" Value="#FFDADADA" />
						</MultiTrigger>
						<Trigger Property="IsEnabled" Value="False">
							<Setter Property="Foreground"
									Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style TargetType="TreeViewItem" BasedOn="{StaticResource TreeViewItem}" />
</ResourceDictionary>